package pildemil

import javax.jdo.annotations.*;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
class Projet implements Serializable {

	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	Key key

	@Persistent
	String nom
	
	@Persistent
	Key responsable
	
	@Persistent
	Integer totalDepense = 0
	
	@Persistent(mappedBy = "projet")
	List<Depense> depenses
	
	@Persistent(mappedBy = "projet")
	List<Participant> participants
	
	@Persistent(mappedBy = "projet")
	List<Transaction> transactions
	
	/* GET SET OVERRIDE */
	
	void setTotalDepense(String s) {
		totalDepense = Utils.depuisDevise(s);
	}
	String getTotalDepense() {
		return Utils.versDevise(totalDepense);
	}
	void setTotalDepenseVal(Integer i) {
		totalDepense = i
	}
	Integer getTotalDepenseVal() {
		return totalDepense
	}
	
}
